package com.yipingnai.blog.mapper;

import com.yipingnai.blog.model.Article;
import com.yipingnai.blog.model.PV;
import com.yipingnai.blog.model.RespPageBean;
import com.yipingnai.blog.model.Tags;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: jiangym
 * @Date: 2020/4/11 13:51
 */
public interface ArticleMapper {

    // 获取最近7天的文章
    public List<Article> getArticleSeven();

    // 本月发表文章数
    public Integer getCountMonth();

    // 本周发表文章数
    public Integer getCountwWeek();



    List<Article> getAllArticles(@Param("page") Integer page,@Param("size") Integer size,@Param("keyword")String keyword);

    // 获取文章数
    Integer getTotal(@Param("cname") String cname,@Param("state") Integer state,@Param("keyword")String keyword);

    Article getDetail(Integer code);

    List<Article> getArticleByCategory(@Param("cname")String cname,@Param("page") Integer page,@Param("size") Integer size);

    List<Article> getHotArticle();

    Integer updateCid(Integer id);

    List<Article> getArticleByState(@Param("state")Integer state,@Param("page") Integer page, @Param("size")Integer size);

    Integer updateArticltStateById(@Param("id")Integer id,@Param("state") Integer state);

    Integer deleteArticleById(Integer id);

    Article getArticleById(Integer id);

    Integer updateArticle(Article article);

    Integer addArticle(Article article);

    void deleteTags(Long id);

    Integer updateViewById(@Param("id")Integer id,@Param("view") Integer view);
}
